package cn.doitedu.sql;

import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;

public class _16_BuildInFunctions {
    public static void main(String[] args) {

        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        StreamTableEnvironment tenv = StreamTableEnvironment.create(env);


        //tenv.executeSql("select upper('jack') ").print();
        //tenv.executeSql("select trim(leading '*' from '**jack**') as res ").print();
        //tenv.executeSql("select char_length( trim('  jack  '))  as res ,trim('  jack  ') as res2").print();
        //tenv.executeSql("select substring('abcdefghijk',4,3)").print();
        //tenv.executeSql("select regexp_extract('foob123452350b','.*b(\\d+)b.*',1)").print();
        //tenv.executeSql("select concat('ab','先生')").print();
        //tenv.executeSql("select concat_ws(',','ab','先生','你好')").print();
        //tenv.executeSql("select now() ").print();
        //tenv.executeSql("select floor(timestamp '2024-03-04 12:36:45' to hour) ").print();
        //tenv.executeSql("select TIMESTAMPADD(HOUR, -1, timestamp '2024-03-04 12:36:45') ").print();
        //tenv.executeSql("select TIMESTAMPDIFF(HOUR, timestamp '2024-03-04 12:36:45', timestamp '2024-03-04 16:32:45') ").print();
        tenv.executeSql("select cast( 10 as bigint) ").print();
        tenv.executeSql("select cast( '2024-03-04' as date) ").print();


        tenv.executeSql("select regexp_extract('/cont/ent/article/2354.html?a=3','(^/.*/).*?')").print();


    }

}
